![]() |
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() |
![]() |
To access the contents, click the chapter and section titles.
Oracle Performance Tuning and Optimization
Tablespaces and Data Files The database is at the highest level and is divided into one or more logical pieces known as tablespaces. A tablespace is used to logically group data together. For example, you can have a tablespace for accounting and a separate tablespace for purchasing. Segmenting groups into different tablespaces simplifies the administration of these groups (see Figure 1.2). Tablespaces are made up of one or more data files. By using more than one data file per tablespace, you can spread the data over many different disks to distribute the I/O load and improve performance.
As part of the process of creating the database, Oracle automatically creates the SYSTEM tablespace for you. Although a small database can fit within the SYSTEM tablespace, it is recommended that you create a separate tablespace for user data. The SYSTEM tablespace is where the data dictionary is kept. The data dictionary contains information about tables, indexes, clusters, and so on. The data files can be operating system files; in the case of some operating systems, the data files can be raw devices. Data files and data access methods are described in detail in Chapter 12, Operating System-Specific Tuning. Database Schema The database schema is a collection of logical structures that define how you see the databases data. These logical structures are known as schema objects. Schema objects are made up of structures such as tables, clusters, indexes, views, stored procedures, database triggers, and sequences.
Segments, Extents, and Data Blocks Within Oracle, the space used to store data is controlled by the use of logical structures. These structures consist of segments, extents, and data blocks. A segment is a set of extents used to store a particular type of data. Segments in turn are made up of collections of pieces called extents; in turn, extents are made up of pieces called data blocks (see Figure 1.3). A block is the smallest unit of storage in an Oracle database. The database block contains header information concerning the block itself as well as the data.
A segment is a group of extents used for storing a particular type of data within the database. An Oracle database can use four different types of segments:
Extents are the building blocks used to create segments; extents are made up of data blocks. An extent is used to minimize the amount of wasted (empty) storage. As more and more data is input into tablespaces in your database, the extents used for storing that data can grow or shrink depending on need. In this manner, many tablespaces can share the same storage space without preallocating the divisions between those tablespaces. At tablespace creation time, you can specify the minimum number of extents to allocate as well as the number of extents to add at a time when that allocation has been used up. This arrangement gives you efficient control over the space used in your database. Data blocks are the smallest pieces that make up an Oracle database; they are physically stored on disk. Although the data block in most systems is 2K (2,04bytes), you can change this size for efficiency depending on your application or operating system. Sizing the data block is described in detail in Chapter 10, Performance Enhancements. The Oracle InstanceThe Oracle instance consists of the Oracle processes and shared memory necessary to access information in the database. The instance is made up of the user processes, the Oracle background processes, and the shared memory used by these processes (see Figure 1.4).
The following sections look at the various pieces that make up the Oracle instance, starting with the shared memory and continuing with the various Oracle processes. The Oracle Memory StructureOracle uses shared memory for several purposes, including caching of data and indexes as well as storing shared program code. This shared memory is used for several functions and is broken into various pieces, or memory structures. The basic memory structures associated with Oracle are the System Global Area (SGA) and the Program Global Area (PGA).
|
![]() |
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. |